package com.yhxd.utils;

import lombok.extern.slf4j.Slf4j;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

@Slf4j
public class JsoupUtils {

    public static String getAction(){
        String action = null;
        try {
            Document html = Jsoup.connect("http://10.11.13.37:8080/szrs/loginpage?type=1").get();
            Element form = html.getElementsByClass("am-form").first();
            log.info("form：" + form.html());
            action = "http://10.11.13.37:8080/szrs/" + form.attr("action");
            log.info("action：" + form.html());
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return action;
    }
}
